package cn.ronghuanet.org.service.impl;

import cn.ronghuanet.base.service.impl.BaseServiceImpl;
import cn.ronghuanet.org.domain.Employee;
import cn.ronghuanet.org.mapper.EmployeeMapper;
import cn.ronghuanet.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public Employee queryByUsername(String username) {
        return employeeMapper.queryByUsername(username);
    }
/*



    @Override
    @Transactional
    public void save(Employee employee) {
        //维护path路径
        */
/*
            1.新增 用户会选择一个parent 或者为null
            2.如果父级部门有值 查询父级部门

         *//*

        employeeMapper.save(employee);

    }

    @Override
    @Transactional
    public void update(Employee employee) {

        employeeMapper.update(employee);
    }

    @Override
    @Transactional
    public void delete(Long id) {
        employeeMapper.delete(id);
    }

    @Override
    public Employee queryById(Long id) {
        return employeeMapper.queryById(id);
    }

    @Override
    public List<Employee> queryAll() {
        return employeeMapper.queryAll();
    }


    @Override
    public PageList<Employee> queryPage(EmployeeQuery query) {
        //用来查询数据的条数
        Long total =  employeeMapper.count(query);
        List<Employee> list= employeeMapper.queryPage(query);
        return new PageList<Employee>( total,list);
    }

    @Override
    public void batchRemove(List<Long> ids) {
        employeeMapper.batchRemove(ids);
    }
*/


}
